//Source file: D:\\test\\com\\ce\\pms\\customer\\model\\PaticipantRelationDO.java

package com.ce.pms.customer.model;

import javax.persistence.Column;
import javax.persistence.Embedded;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;


import com.ce.pms.common.model.SysInfo;
import com.sitechasia.webx.core.model.IDomainObject;

/**
 * 实体名称:参与人关系 关系表：CS_PARTICIPANT_RELATION
 * @author Adama Yue
 */
@Entity
@Table(name = "CS_PARTICIPANT_RELATION")
public class ParticipantRelationDO implements IDomainObject{
	@Id
	@GeneratedValue
	@Column(name = "PARTICIPANT_RELATION_ID")
	private Long participantRelationId;

	@ManyToOne(cascade = {}, fetch = FetchType.EAGER)
	@org.hibernate.annotations.Cascade(value={
			org.hibernate.annotations.CascadeType.SAVE_UPDATE
	})
	@JoinColumn(name = "PARTICIPANT_ID1",nullable=false,insertable=true,updatable=true)
	private ParticipantDO participant1;

	@ManyToOne(cascade = {}, fetch = FetchType.EAGER)
	@org.hibernate.annotations.Cascade(value={
			org.hibernate.annotations.CascadeType.SAVE_UPDATE
	})
	@JoinColumn(name = "PARTICIPANT_ID2",nullable=false,insertable=true,updatable=true)
	private ParticipantDO participant2;

	/**
	 * 检索策略:lazy=false
	 */
	@ManyToOne(cascade = {}, fetch = FetchType.EAGER)
	@org.hibernate.annotations.Cascade(value={
			org.hibernate.annotations.CascadeType.SAVE_UPDATE
	})
	@JoinColumn(name = "RELATION_TYPE_ID",nullable=false,insertable=true,updatable=true)
	private RelationTypeDO relationType;

	@Embedded
	private SysInfo sysInfo;

	public ParticipantRelationDO() {

	}
	/**
	 * mini constructor
	 * @param participant1 参与人1
	 * @param participant2 参与人2
	 * @param relationType 他们的关系
	 * @param sysInfo 系统信息
	 */
	public ParticipantRelationDO(ParticipantDO participant1, ParticipantDO participant2, RelationTypeDO relationType, SysInfo sysInfo) {
		super();
		this.participant1 = participant1;
		this.participant2 = participant2;
		this.relationType = relationType;
		this.sysInfo = sysInfo;
	}
	/**************************************************
	 * Accessors and Modifiers
	 **************************************************/
	public ParticipantDO getParticipant1() {
		return participant1;
	}
	public void setParticipant1(ParticipantDO participant1) {
		this.participant1 = participant1;
	}
	public ParticipantDO getParticipant2() {
		return participant2;
	}
	public void setParticipant2(ParticipantDO participant2) {
		this.participant2 = participant2;
	}
	public Long getParticipantRelationId() {
		return participantRelationId;
	}
	public void setParticipantRelationId(Long participantRelationId) {
		this.participantRelationId = participantRelationId;
	}
	public RelationTypeDO getRelationType() {
		return relationType;
	}
	public void setRelationType(RelationTypeDO relationType) {
		this.relationType = relationType;
	}
	public SysInfo getSysInfo() {
		return sysInfo;
	}
	public void setSysInfo(SysInfo sysInfo) {
		this.sysInfo = sysInfo;
	}


}
